import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  View,
  NavigatorIOS
} from 'react-native';



var Navigation = React.createClass({
  render: function () {
    // root
    var rootRoute = {
      component: this.props.component,
      passProps: {

      }
    };

    return (
      <NavigatorIOS
          initialRoute={rootRoute}
          configureScene={() => {return Navigator.SceneConfigs.PushFromRight}}
          renderScence={(route,navigator) => {
            var Component = route.component;
            return (
                <Component
                    style={{flex:1}}
                    navigator={navigator}
                    route={route}
                    {...route.passProps}
                />
            );
          }}
      />
    );
  }
});

{/*<Navigator*/}
{/*initialRoute={rootRoute}*/}
{/*configureScene={() => {return Navigator.SceneConfigs.PushFromRight}}*/}
{/*renderScene={(route, navigator) => {*/}
{/*var Component = route.component;*/}
{/*return (*/}
{/*<View style={{flex:1}}>*/}
{/*<Component*/}
{/*navigator={navigator}*/}
{/*route={route}/>*/}
{/*<View/>*/}
{/*)*/}
{/*}}/>*/}

module.exports = Navigation;
